<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <title>ctp.ui.grid示例</title>
        <script type='text/javascript'>

            var CTP_WEB_FULLPATH ='../../';

        </script>
        <link href='../../css/jquery/ui.core.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/jquery/ui.theme.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/skins/standard/ctp-common.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/validator.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/borderlayout.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/panel.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/groupbox.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/gridlayout.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/label.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/radiogroup.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/radio.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/checkboxgroup.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/checkbox.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/textfield.css' rel='stylesheet' type='text/css'/>
        <link href='../../css/button.css' rel='stylesheet' type='text/css'/>
		<link href='../../css/menus.css' rel='stylesheet' type='text/css'/>
		<link href='../../css/grid.css' rel='stylesheet' type='text/css'/>
		<link href='../../css/link.css' rel='stylesheet' type='text/css'/>
		<link href='../../css/borderlayout.css' rel='stylesheet' type='text/css'/>
		<link href='../../css/combobox.css' rel='stylesheet' type='text/css'/>
		<link href='../../css/datepicker.css' rel='stylesheet' type='text/css'/>
        <script type='text/javascript' src='../../js/jquery/jquery.js'></script>
        <script type='text/javascript' src='../../js/jquery/jquery-migrate.js'></script>
        <script type='text/javascript' src='../../js/jqueryui/jquery-ui.js'></script>
        <script type='text/javascript' src='../../js/ctp/public/jsextend.js'></script>
        <script type='text/javascript' src='../../js/ctp/public/ctp.core.js'></script>
		<script type='text/javascript' src='../../js/ctp/public/ctp.base.js'></script>
		<script type='text/javascript' src='../../js/ctp/public/ctp.ui.component.js'></script>
        <script type='text/javascript' src='../../js/ctp/validator/ctp.validator-rules.js'></script>
        <script type='text/javascript' src='../../js/ctp/validator/ctp.validator.js'></script>
        <script type='text/javascript' src='../../js/ctp/borderlayout/ctp.ui.borderlayout-noresize.js'></script>
        <script type='text/javascript' src='../../js/ctp/borderlayout/ctp.ui.borderlayout-resize.js'></script>
        <script type='text/javascript' src='../../js/ctp/borderlayout/ctp.ui.borderlayout.js'></script>
        <script type='text/javascript' src='../../js/ctp/borderlayout/jquery.layout.js'></script>
        <script type='text/javascript' src='../../js/ctp/panel/ctp.ui.panel.js'></script>
        <script type='text/javascript' src='../../js/ctp/public/jquery.bgiframe.js'></script>
        <script type='text/javascript' src='../../js/ctp/groupbox/ctp.ui.groupbox.js'></script>
        <script type='text/javascript' src='../../js/ctp/gridlayout/ctp.ui.gridlayout.js'></script>
        <script type='text/javascript' src='../../js/ctp/label/ctp.ui.label.js'></script>
        <script type='text/javascript' src='../../js/ctp/radiogroup/ctp.ui.radiogroup.js'></script>
        <script type='text/javascript' src='../../js/ctp/radio/ctp.ui.radio.js'></script>
        <script type='text/javascript' src='../../js/ctp/checkboxgroup/ctp.ui.checkboxgroup.js'></script>
        <script type='text/javascript' src='../../js/ctp/checkbox/ctp.ui.checkbox.js'></script>
        <script type='text/javascript' src='../../js/ctp/textfield/ctp.ui.textfield.js'></script>
        <script type='text/javascript' src='../../js/jquery/jquery.autocomplete.js'></script>
        <script type='text/javascript' src='../../js/ctp/button/ctp.ui.button.js'></script>
		<script type='text/javascript' src='../../js/ctp/combobox/ctp.ui.combobox.js'></script>
		<script type='text/javascript' src='../../js/ctp/menus/ctp.ui.menus.js'></script>
		<script type='text/javascript' src='../../js/ctp/datepicker/ui.datepicker.js'></script>
		<script type='text/javascript' src='../../js/ctp/datepicker/ctp.ui.datepicker.js'></script>
		<script type='text/javascript' src='../../js/ctp/plugin/ctp.editable.js'></script>
		<script type='text/javascript' src='../../js/ctp/link/ctp.ui.link.js'></script>
		<script type='text/javascript' src='../../js/ctp/statusbar/ctp.ui.statusbar.js'></script>
		<script type='text/javascript' src='../../js/ctp/grid/ctp.ui.grid.js'></script>	
        <script type='text/javascript' kind='variant'>
            var panel1;
            var gbSample;
            var gbBtns;
            var gridlayout1;
            var gridType;
            var grid_attr;
            var head_attr;
            var showRows;
            var cacheRows;
            var btnToSample;
            var btnClear;
            var gridlayout4;
            var btnLoadData;
            var btnFillData;
            var btnOnselect;
            var btnSelData;
            var btnSelID;
            var btnData;
            var btnSelbyID;
            var selID;
            var btnSelByIdx;
            var idx;
            var btnHL;
            var keyword;
            var btnUnSelAll;
            var btnUnHL;
            var btnGoto;
            var gotoPageNum;
            var gbFn;
            var panelFn;
            var gbCode;
            var panelCode;
            var panelSample;
			var gbAct;
			var sampleGrid;
			var bl;
			var btnGetVal;
        </script>
        <script type='text/javascript' kind='event'>
        	//ctp.core.log.lvl = ctp.core.loglvl.obj;
			function codeStr(splitor){
				var s=[];
				s.push("new ctp.ui.grid({");
                s.push("id: \"sampleGrid\",");
				(grid_attr.getValue())?s.push(grid_attr.getValue()+","):"";
                s.push("height:\"100%\",");
                s.push("header: {");
                s.push("title:");        
                s.push("[[{text:\"选择\"},");
                s.push("{text: \"序号\"},");
                s.push("{text: \"ID\"},");
                s.push("{text:\"功能名称\"},");
                s.push("{text: \"显示文字\"},");
                s.push("{text: \"状态\"}");
                s.push("]],");
                s.push("rowIdFieldName:\"itemId\",");
                s.push("attr: [{colType:\"checkbox\"},");
                s.push("{colType:\"seqnum\"},");
                s.push("{fieldName: \"itemId\"},");
                s.push("{fieldName: \"itemName\"");
				(head_attr.getValue())?s.push(","+head_attr.getValue()):"";
				(head_attr.isItemChecked("isLink"))?s.push(",fieldType:\"link\",fieldAttr:{onClick:linkOnclick}"):"";
				s.push("},");
				s.push('{fieldName: "itemLabel"');
				(gridType.getValue()=="editable")?s.push(',fieldType:"textfield"'):"";
				s.push('},');
				s.push('{fieldName:"itemStatusText"');
				(gridType.getValue()=="editable")?s.push(',fieldType:"datepicker",fieldAttr:{options:{items:[{text:"激活",value:"1"},{text:"冻结",value:"0"}]}}'):"";
				s.push('}]');
                s.push('},');
                s.push('title: "grid示例：功能列表",');
				s.push('url:"data.json",');
				s.push('renderTo:bl.panes.north');				
				//(gridType.getValue()=="bypage")?s.push(',footer:{showRows:'+~~showRows.getValue()+',cacheRows:'+~~cacheRows.getValue()+'}'):"";
				(gridType.getValue()=="bypage")?s.push(',footer:{showRows:10,cacheRows:100}'):"";
				s.push('});');
				return s.join(splitor);                
			}
			
            function createSample(){
				/*if (sampleGrid) {
					sampleGrid.getJqDom().unbind().remove();
					sampleGrid.getJqDom().empty();
					sampleGrid = null;
					panelSample.getContentJqDom().children().unbind().remove();
					panelSample.getContentJqDom().unbind().empty();
				}*/
				
				$("pre[type=objcode]").text("/*构造对象*/\rvar sampleGrid = "+codeStr("\r").replace(",isLink","").replace(/.,+(?!$)/gm,"$&\r"));
				if(head_attr.isItemChecked("isLink")){
					panelFn.getContentJqDom().append("<pre>function linkOnclick(){\r\talert(this.itemLabel);\r}</pre>")
					gbFn.show();
				}
				if(grid_attr.isItemChecked("onLoadEvent")){
					panelFn.getContentJqDom().append("<pre>function eventOnload(data){\r\tvar dataStr=ctp.data.jsonToStr(data[1]);\r\tvar total=data[0].totalNum;\r\talert(\"加载完成\\r\\n总记录数:\"+total+\"\\r\\n第一行数据:\"+dataStr);\r}</pre>")
					gbFn.show();
				}
				if(grid_attr.isItemChecked("onTurnEvent")){
					panelFn.getContentJqDom().append("<pre>function eventOnTurn(){\r\talert(\"翻页完成\");\r}</pre>")
					gbFn.show();
				}
				
				panelFn.getContentJqDom().append("<pre type=eventcode></pre>")
				
				if(gridType.getValue()=="editable"){
					btnGetVal.setDisable(false);
				}		
				//document.write(codeStr("").replace(/url:"data.json",|,isLink/gm,""));
				
				//本地打开静态文件不支持加分页参数，只有出此下策
				sampleGrid = eval(codeStr("").replace(/url:"data.json",|,isLink/gm,""));
				gbAct.show();
				gridType.setDisable(true);
				grid_attr.setDisable(true);
				head_attr.setDisable(true);
				btnToSample.setDisable(true);

				
				$.getJSON("data.json",function(data){sampleGrid.fillData(data);});
				
            }

			function copy(){
				//dp.sh.Toolbar.Command('CopyToClipboard',this);
				//return false;
			}
			
            function clearSample(){
				location.href = location.href;
			}
			
			function eventOnload(data){
				var dataStr=ctp.data.jsonToStr(data[1]);
				var total=data[0].totalNum;
				alert("加载完成\r\n总记录数:"+total+"\r\n第一行数据:"+dataStr);
			}
			
			function eventOnTurn(){
				alert("翻页完成");
			}

			function typeChange(){
				if(gridType.isItemChecked("bypage")){
					disableBtn(false)
				}
				else{
					disableBtn(true);
				}
			}
			
			function disableBtn(flag){
				grid_attr.setItemDisable("onTurnEvent",flag);
				btnGoto.setDisable(flag);
				gotoPageNum.setDisable(flag);
			}
			
			function linkOnclick(){
				alert(this.itemLabel);
			}

            function loadData(){
				$.getJSON("data1.json",function(data){sampleGrid.fillData(data);});
				//var url=location.href;
				//url=url.substring(0,url.lastIndexOf("/"));
				//sampleGrid.loadData(url+"/data1.json");
				$("pre[type=actioncode]").text("sampleGrid.loadData(\"data1.json\");");
            }

            function fillData(){
				var data=[{
					"totalNum":"2"
				}, {
					"itemId": "IM00019",
					"itemName": "itemsearch",
					"itemDesc": "",
					"itemLabel": "itemsearch",
					"itemStatus": "1",
					"itemStatusText": "激活",
					"itemLevel": "100",
					"itemBranchId": "",
					"itemUrl": "itemlist.flowc?flowActionName=itemlist",
					"itemType": "2"
				}, {
					"itemId": "Ii111111",
					"itemName": "testdfasfds",
					"itemDesc": "",
					"itemLabel": "test",
					"itemStatus": "1",
					"itemStatusText": "激活",
					"itemLevel": "100",
					"itemBranchId": "",
					"itemUrl": "test",
					"itemType": "2"
				}]
				sampleGrid.fillData(data);
				$("pre[type=actioncode]").text("var data="+ctp.data.jsonToStr(data).replace(/,/g,",\r")+";\rsampleGrid.fillData(data);");
            }

            function setOnselect(){
				var fn="function onSelectEvent(){\ralert(ctp.data.jsonToStr(sampleGrid.getSelectedData()));\r}";
				var fn1="sampleGrid.onSelect(onSelectEvent);";
				$("pre[type=eventcode]").text(fn);
				$("pre[type=actioncode]").text(fn1);				
				sampleGrid.onSelect(function(){alert(ctp.data.jsonToStr(sampleGrid.getSelectedData()))});
				gbFn.show();
				alert("现在选中行将触发事件，显示行数据内容");
            }

            function getSelData(){
				$("pre[type=actioncode]").text("var data=sampleGrid.getSelectedData();");
				alert("实际返回为对象数组，此处演示以字符串方式显示数据对象内容:\r"+ctp.data.jsonToStr(sampleGrid.getSelectedData()));
            }

            function getSelID(){
				$("pre[type=actioncode]").text("var data=sampleGrid.getSelectedRowId();");
				alert("实际返回为字符串数组，此处演示以字符串方式显示数据内容:\r"+sampleGrid.getSelectedRowId());
            }

            function getData(){
				$("pre[type=actioncode]").text("var data=sampleGrid.getData();");
				alert("实际返回为对象数组，此处演示以字符串方式显示数据对象内容:\r"+ctp.data.jsonToStr(sampleGrid.getData()));
            }

            function selByID(){
				$("pre[type=actioncode]").text("sampleGrid.selectByRowId("+selID.getValue()+");");
				alert("选中ID为"+selID.getValue()+"的记录");
				sampleGrid.selectByRowId(selID.getValue());
            }

            function selByIdx(){
				$("pre[type=actioncode]").text("sampleGrid.selectByRowIdx("+idx.getValue()+",true);");
				alert("选中第"+idx.getValue()+"行记录（以0开始计算）并触发事件（若有设置行选中事件时）");
				sampleGrid.selectByRowIdx(idx.getValue(),true);
            }

            function mark(){
				alert(keyword.getValue())
				$("pre[type=actioncode]").text("sampleGrid.markWord("+keyword.getValue()+");");
				sampleGrid.markWord(keyword.getValue());
            }

            function unSel(){
				$("pre[type=actioncode]").text("sampleGrid.unselectAll();");
				sampleGrid.unselectAll();
            }

            function unMark(){

            }

            function gotoPage(){
				if (~ ~ gotoPageNum.getValue()) {
					$("pre[type=actioncode]").text("sampleGrid.gotoPage(" + ~ ~ gotoPageNum.getValue() + ");");
					sampleGrid.gotoPage(~ ~ gotoPageNum.getValue());
				}
				else {
					$("pre[type=actioncode]").text("");
					alert("输入页码错误");
				}
            }

			function getVal(){
				$("pre[type=actioncode]").text("var submitData=sampleGrid.getJsonVal();");
				alert("实际返回为对象数组，此处演示以字符串方式显示数据对象内容:\r"+ctp.data.jsonToStr(sampleGrid.getJsonVal()));
			}
        </script>
        <script type='text/javascript' kind='ui'>

            $(document).ready(function(){
				bl = new ctp.ui.borderlayout({
					type:"2E",
					north__closable:false
				});
				bl.create();
				
				
				
				
				
				/*
				panelSample = new ctp.ui.panel({
                    id: 'panelSample',
                    title: '面板',
                    style: 'none',
					height:'300px',
                    items: [

                    ]
                });

                gbSample = new ctp.ui.groupbox({
                    id: 'gbSample',
                    title: '效果展示区',
                    items: [
						panelSample
                    ],
					renderTo:bl.panes.north
                });
                */

                gridType = new ctp.ui.radiogroup({
                    id: 'gridType',
                    display: 'cols',
                    items: [
                        {
                            id: 'radio17',
                            label: '全量表格',
                            value: 'all',
                            checked: true
                        }
                        , 
                        {
                            id: 'bypage',
                            label: '翻页表格',
                            value: 'bypage'
                        }
                        , 
                        {
                            id: 'radio48',
                            label: '可编辑表格',
                            value: 'editable'
                        }
                    ],
					onChange:typeChange
                });

                grid_attr = new ctp.ui.checkboxgroup({
                    id: 'grid_attr',
                    display: 'cols',
                    items: [
                        {
                            id: 'checkbox3',
                            label: '不带panel样式',
                            value: 'noPanel:true'
                        }
                        , 
                        {
                            id: 'onLoadEvent',
                            label: '加载完成事件',
                            value: 'onLoad:eventOnload'
                        }
                        , 
                        {
                            id: 'onTurnEvent',
                            label: '翻页事件',
                            value: 'onTurn:enevtOnturn',
                            disabled: true
                        }
                    ]
                });

                head_attr = new ctp.ui.checkboxgroup({
                    id: 'head_attr',
                    display: 'cols',
                    items: [
                        {
                            id: 'resize',
                            label: '不可调整列宽',
                            value: 'resizable:false'
                        }
                        , 
                        {
                            id: 'sort',
                            label: '不可排序',
                            value: 'sortable:false'
                        }
						, 
                        {
                            id: 'isLink',
                            label: '链接形式',
                            value: 'isLink'
                        }
                    ]
                });

                showRows = new ctp.ui.textfield({
                    id: 'showRows',
                    type: 'text',
                    value: '10',
                    width: '30px',
                    disabled: true
                });

                cacheRows = new ctp.ui.textfield({
                    id: 'cacheRows',
                    type: 'text',
                    value: '20',
                    width: '30px',
                    disabled: true
                });

                btnToSample = new ctp.ui.button({
                    id: 'btnToSample',
                    text: '创建到展示区',
                    onClick: createSample
                });

                btnClear = new ctp.ui.button({
                    id: 'btnClear',
                    text: '重置',
                    onClick: clearSample
                });

                gridlayout1 = new ctp.ui.gridlayout({
                    id: 'gridlayout1',
                    width: '100%',
                    cols: 4,
                    colSpace: 2,
                    items: [
                        [
                            {
                                colspan: 4, 
                                label: {
                                    id: 'label4', 
                                    text: '类型：', 
                                    width: '42px'
                                }, 
                                element: gridType
                            }                            
                        ]
                        ,
                        [
                            {
                                colspan: 2, 
                                label: {
                                    id: 'label1', 
                                    text: '部分属性：', 
                                    width: '66px'
                                }, 
                                element: grid_attr
                            }                            
                            ,
                            {
                                colspan: 2, 
                                label: {
                                    id: 'label6', 
                                    text: '第四列(功能名称/ItemName)属性：', 
                                    width: '200px'
                                }, 
                                element: head_attr
                            }                            
                        ]
                        ,
                        [
                            {
                                /*label: {
                                    id: 'label5', 
                                    text: '每页条数：', 
                                    width: '66px'
                                }, 
                                element: showRows*/
                            }                            
                            ,
                            {
                                /*label: {
                                    id: 'label2', 
                                    text: '缓存条数：', 
                                    width: '66px'
                                }, 
                                element: cacheRows*/
                            }                            
                            ,
                            {
                                element: btnToSample
                            }                            
                            ,
                            {
                                element: btnClear
                            }                            
                        ]
                    ]
                });

                btnLoadData = new ctp.ui.button({
                    id: 'btnLoadData',
                    text: '异步加载数据',
                    onClick: loadData
                });

                btnFillData = new ctp.ui.button({
                    id: 'btnFillData',
                    text: '填充数据',
                    onClick: fillData
                });

                btnOnselect = new ctp.ui.button({
                    id: 'btnOnselect',
                    text: '设置行选中事件',
                    onClick: setOnselect,
					width:"100px"
                });

                btnSelData = new ctp.ui.button({
                    id: 'btnSelData',
                    text: '取得选中行数据',
                    onClick: getSelData,
					width:"100px"
                });

                btnSelID = new ctp.ui.button({
                    id: 'btnSelID',
                    text: '取得选中行的ID',
                    onClick: getSelID,
					width:"100px"
                });

                btnData = new ctp.ui.button({
                    id: 'btnData',
                    text: '取得当前页数据',
                    onClick: getData,
					width:"100px"
                });

                btnSelbyID = new ctp.ui.button({
                    id: 'btnSelbyID',
                    text: '按ID选中行',
                    onClick: selByID
                });

                selID = new ctp.ui.textfield({
                    id: 'selID',
                    type: 'text'
                });

                btnSelByIdx = new ctp.ui.button({
                    id: 'btnSelByIdx',
                    text: '按行位置选中行',
                    onClick: selByIdx,
					width:"100px"
                });

                idx = new ctp.ui.textfield({
                    id: 'idx',
                    type: 'text'
                });

                btnHL = new ctp.ui.button({
                    id: 'btnHL',
                    text: '高亮标记关键字',
                    onClick: mark,
					width:"100px"
                });

                keyword = new ctp.ui.textfield({
                    id: 'keyword',
                    type: 'text'
                });

                btnUnSelAll = new ctp.ui.button({
                    id: 'btnUnSelAll',
                    text: '取消所有选中行',
                    onClick: unSel,
					width:"100px"
                });

                btnUnHL = new ctp.ui.button({
                    id: 'btnUnHL',
                    text: '取消高亮标记',
                    onClick: unMark,
					width:"100px"
                });

                btnGoto = new ctp.ui.button({
                    id: 'btnGoto',
                    text: '跳转到指定页',
                    disabled: true,
                    onClick: gotoPage,
					width:"100px"
                });

                gotoPageNum = new ctp.ui.textfield({
                    id: 'gotoPageNum',
                    type: 'text',
                    disabled: true
                });
				
				btnGetVal = new ctp.ui.button({
                    id: 'btnGetVal',
                    text: '取得可编辑表格的提交数据',
                    disabled: true,
                    onClick: getVal,
					width:"170px"
                });

                gridlayout4 = new ctp.ui.gridlayout({
                    id: 'gridlayout4',
                    width: '100%',
                    cols: 4,
                    colSpace: 2,
                    items: [
                        [
                            {
                                element: btnLoadData
                            }                            
                            ,
                            {
                                element: btnFillData
                            }                            
                            ,
                            {
                                element: btnOnselect
                            }                            
                            ,
                            {
                                element: btnSelData
                            }                            
                        ]
                        ,
                        [
                            {
                                element: btnSelID
                            }                            
                            ,
                            {
                                element: btnData
                            }                            
                            ,
                            {
                                element: btnSelbyID
                            }                            
                            ,
                            {
                                label: {
                                    id: 'label7', 
                                    text: 'ID:', 
                                    width: '24px'
                                }, 
                                element: selID
                            }                            
                        ]
                        ,
                        [
                            {
                                element: btnSelByIdx
                            }                            
                            ,
                            {
                                label: {
                                    id: 'label8', 
                                    text: 'Idx:', 
                                    width: '30px'
                                }, 
                                element: idx
                            }                            
                            ,
							{
                                element: btnUnSelAll
                            }
							,
							{
                                element: btnGetVal
                            }
							      
                            /*{
                                element: btnHL
                            }                            
                            ,
                            {
                                label: {
                                    id: 'label9', 
                                    text: '关键字:', 
                                    width: '48px'
                                }, 
                                element: keyword
                            } */                           
                        ]
                        ,
                        [
                            /*                        
                            ,
                            {
                                element: btnUnHL
                            },                            
                            */
                            
                            {
                                element: btnGoto
                            }                            
                            ,
                            {
                                element: gotoPageNum
                            }                          
                        ]
                    ]
                });

                gbBtns = new ctp.ui.groupbox({
                    id: 'gbBtns',
                    title: '对象创建区',
                    items: [
                        gridlayout1
                    ]
                });
				
				gbAct = new ctp.ui.groupbox({
                    id: 'gbAct',
                    title: '对象方法测试区',
                    items: [
                        gridlayout4
                    ]
                });

                panelFn = new ctp.ui.panel({
                    id: 'panelFn',
                    title: '面板',
                    style: 'none',
					height:'auto',
                    items: [

                    ]
                });

                gbFn = new ctp.ui.groupbox({
                    id: 'gbFn',
                    title: 'Function',
                    items: [
                        panelFn
                    ]
                });

                panelCode = new ctp.ui.panel({
                    id: 'panelCode',
                    title: '面板',
                    style: 'none',
					height:'auto',
                    items: [

                    ]
                });

                gbCode = new ctp.ui.groupbox({
                    id: 'gbCode',
                    title: '示例代码',
                    items: [
                        panelCode
                    ]
                });
				
				panel1 = new ctp.ui.panel({
                    id: 'panel1',
                    title: 'grid示例',
					width: '100%',
					height:"100%",
                    items: [
                        //gbSample,
                        gbBtns,
						gbAct,
                        gbFn,
                        gbCode
                    ],
                    renderTo: bl.panes.center
                });
				
				//showRows.hide();
				//cacheRows.hide();
				gbFn.hide();
				gbAct.hide();
				panelCode.getContentJqDom().html("").append("<a style='font-size:9pt;display:none;' onclick=copy href='javascript:void(0)'>拷贝代码</a><pre type=objcode></pre><pre>/*对象方法调用*/</pre><pre type=actioncode></pre>");
				
            });

        </script>
    </head>
    <body>

    </body>
</html>
